#include "head.hpp"

void foo(int a)
{
    cout << a << endl;
}


int main()
{
    ucontext_t uc, main;
    char st[1024*8];
    getcontext(&uc);

    uc.uc_stack.ss_sp = st;
    uc.uc_stack.ss_size = 1024*8;
    uc.uc_link = &main;
    makecontext(&uc, (void(*)())foo, 1, 10);
    swapcontext(&main, &uc);
    cout << "end" << endl;
}